package com.zecan.blog.dao.converter;

import com.zecan.blog.dto.message.MessageDto;
import com.zecan.blog.entity.Message;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;


/**
 * @ClassName BlogMessageConverter
 * @Description
 * @date 2022/11/22 21:57
 * @Version 1.0
 */
@Mapper
public interface BlogMessageConverter {

    BlogMessageConverter INSTANCE = Mappers.getMapper(BlogMessageConverter.class);




    @Mappings({
            @Mapping(target = "messageUsername",source = "username"),
            @Mapping(target = "messageAvatar",source = "avatar"),
            @Mapping(target = "messageContent",source = "messageContent"),
            @Mapping(target= "messageTimer",source = "time")
    })
    Message blogMessageConverter(MessageDto messageDto);
}
